﻿<UserControl 
    x:Class="HelloWorld.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" 
    d:DesignWidth="400" 
    DataContext="{Binding Source={StaticResource Locator}, Path=MainPageViewModel}" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:my="http://www.codeplex.com/prism" xmlns:my1="clr-namespace:Codeplex.KinkumaFramework.Interactivity;assembly=KinkumaFramework.SL4" xmlns:my2="clr-namespace:Codeplex.KinkumaFramework.Behaviors;assembly=KinkumaFramework.SL4">

    <Grid x:Name="LayoutRoot" Background="White">
        <i:Interaction.Triggers>
            <my:InteractionRequestTrigger SourceObject="{Binding Path=MessageBoxRequest}">
                <my1:MessageBoxTriggerAction />
            </my:InteractionRequestTrigger>
        </i:Interaction.Triggers>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="86*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="129*" />
        </Grid.RowDefinitions>
        <sdk:Label Name="label1" Target="{Binding ElementName=textBox1}" PropertyPath="Input1" />
        <TextBox Name="textBox1" Grid.Column="1" Margin="5" MinWidth="200" Text="{Binding Path=Input1.Value, Mode=TwoWay, NotifyOnValidationError=True}">
            <i:Interaction.Behaviors>
                <my:UpdateTextBindingOnPropertyChanged />
            </i:Interaction.Behaviors>
        </TextBox>
        <sdk:DescriptionViewer Grid.Column="2" Target="{Binding ElementName=textBox1}" PropertyPath="Input1" />
        <sdk:Label Name="label2" Grid.Row="1" Target="{Binding ElementName=textBox2}" PropertyPath="Input2" />
        <TextBox Name="textBox2" Grid.Row="1" Grid.Column="1" Margin="5" MinWidth="200" Text="{Binding Path=Input2.Value, Mode=TwoWay, NotifyOnValidationError=True}">
            <i:Interaction.Behaviors>
                <my:UpdateTextBindingOnPropertyChanged />
            </i:Interaction.Behaviors>
        </TextBox>
        <sdk:DescriptionViewer Grid.Row="1" Grid.Column="2" PropertyPath="Input2" Target="{Binding ElementName=textBox2}" />
        <Button Content="Hello world" Name="button1" Grid.Row="2" Grid.ColumnSpan="3" Command="{Binding Path=ShowWindowCommand}" />
        <sdk:ValidationSummary Grid.ColumnSpan="3" Grid.Row="3">
            <i:Interaction.Behaviors>
                <my2:ValidationSummaryReactivePropertySupportBehavior />
            </i:Interaction.Behaviors>
        </sdk:ValidationSummary>
    </Grid>
</UserControl>
